#!/bin/bash
#
DB_ROOT_PW='ec9cd31a611f64b5'
host_file=$1

cmd1='''/usr/local/mysql/bin/mysql -uroot -pec9cd31a611f64b5 -e "GRANT ALL PRIVILEGES  ON *.* TO 'website'@'14.23.168.10' IDENTIFIED BY  'fc4d9a4c31acbd1c3396542ce0778e90'"'''
cmd2='''/usr/local/mysql/bin/mysql -uroot -pec9cd31a611f64b5 -e "GRANT ALL PRIVILEGES  ON *.* TO 'website'@'127.0.0.1' IDENTIFIED BY  'fc4d9a4c31acbd1c3396542ce0778e90'"'''

for i in `cat host_file`;do
	echo $i
	ssh $i -n $cmd1
	ssh $i -n $cmd2
done